{% extends "camera/base.html" %}
{% load i18n %}

{% block title %}Camera{% endblock %}

{% block extrahead %}
<script type="text/javascript" src="/site_media/MochiKit.js"></script>

<script type="text/javascript">

var latest_image = null;

function update_picture(){
    var defer = loadJSONDoc('latest-picture');
    
    var gotResult = function(result){
	if ( latest_image != result.name ){
	    latest_image = result.name;
	    $("picture").src='grab/picture/' + result.name;
	}
    }
    
    var err = function(result){
	alert(err)
    }
    defer.addCallbacks(gotResult, err);
}

setInterval("update_picture()", 300);
</script>

{% endblock %}

{% block content %}

<div class="content-main">
    <div class="inner">
	<img id="picture" alt="{% trans "not loaded yet" %}"></img>
    </div>
</div>

{% include "camera/camera_info.html" %}

{% endblock %}
